Skip to content
Handle base64 encoding and decoding inside CouchDB, eg. in list functions.
JavaScript
Branch: master
Clone or download
Latest commit 83f7c9f Aug 19, 2014
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
.travis.yml
README.md
couch64.js
package.json

README.md

couch64

Handle base64 encoding and decoding inside CouchDB (and node) using typed arrays.

Build Status

The code comes from Mozilla:

/*\
|*|
|*|  Base64 / binary data / UTF-8 strings utilities
|*|
|*|  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding
|*|
\*/

Usage:

var couch64 = require('couch64')

var sMyInput = "Base 64 \u2014 Mozilla Developer Network"

var aMyUTF8Input = couch64.strToUTF8Arr(sMyInput)
var sMyBase64 = couch64.base64EncArr(aMyUTF8Input)
log(sMyBase64)

var aMyUTF8Output = couch64.base64DecToArr(sMyBase64)
var sMyOutput = couch64.UTF8ArrToStr(aMyUTF8Output)
log(sMyOutput)

API

base64EncArr(aBytes)

Array of bytes to base64 string decoding

base64DecToArr(sBase64, nBlocksSize)

Base64 string to UTF-8 array encoding

UTF8ArrToStr(aBytes)

UTF-8 array to DOMString

strToUTF8Arr(sDOMStr)

DOMString to UTF-8 array

License

All the code coming from Base64 encoding and decoding by Mozilla Contributors is licensed under CC-BY-SA 2.5 (as well as the little rest)

(c) 2014 Johannes J. Schmidt

You can’t perform that action at this time.