Sha256: cfc5b5baa4f51bcab024db86e923f522d0f9c345e530c4fdf94f73afb9c952a9

Contents?: true

Size: 552 Bytes

Versions: 7

Compression:

Stored size: 552 Bytes

Contents

var test = require('tape')
var b64 = require('../lib/b64')

test('convert big data to base64', function (t) {
  var b64str, arr, i, length
  var big = new Uint8Array(64 * 1024 * 1024)
  for (i = 0, length = big.length; i < length; ++i) {
    big[i] = i % 256
  }
  b64str = b64.fromByteArray(big)
  arr = b64.toByteArray(b64str)
  t.ok(equal(arr, big))
  t.end()
})

function equal (a, b) {
  var i
  var length = a.length
  if (length !== b.length) return false
  for (i = 0; i < length; ++i) {
    if (a[i] !== b[i]) return false
  }
  return true
}

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
minimum_viable_product-0.0.11 test/dummy/node_modules/base64-js/test/big-data.js
brwy_rails-0.0.6 test/dummy/node_modules/base64-js/test/big-data.js
brwy_rails-0.0.5 test/dummy/node_modules/base64-js/test/big-data.js
brwy_rails-0.0.4 test/dummy/node_modules/base64-js/test/big-data.js
brwy_rails-0.0.3 test/dummy/node_modules/base64-js/test/big-data.js
brwy_rails-0.0.2 test/dummy/node_modules/base64-js/test/big-data.js
brwy_rails-0.0.1 test/dummy/node_modules/base64-js/test/big-data.js