Skip to content

Instantly share code, notes, and snippets.

@Restuta
Created February 8, 2018 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Restuta/1c60d6f9d204a12be00d57ecd2e5a4b3 to your computer and use it in GitHub Desktop.
Save Restuta/1c60d6f9d204a12be00d57ecd2e5a4b3 to your computer and use it in GitHub Desktop.
Base64 encode N times
// https://runkit.com/embed/ogydgfyotoqc
var base64 = require("base-64")
const R = require('ramda')
var utf8 = require('utf8')
var text = 'Yeah, right?!'
const encode = R.pipe(utf8.encode, base64.encode)
const encodeN = R.pipe(...R.times(() => encode, 16))
console.log(encodeN('hello'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment