Browse Source

Removed browser-native option (gave me a bad result)

hk-custom-address
vub 11 years ago
parent
commit
3d3421ce17
  1. 6
      bitcoinjs-min.js
  2. 4
      src/convert.js

6
bitcoinjs-min.js

File diff suppressed because one or more lines are too long

4
src/convert.js

@ -20,8 +20,6 @@ module.exports.hexToBytes = function(hex) {
// Convert a byte array to a base-64 string
module.exports.bytesToBase64 = function(bytes) {
// Use browser-native function if it exists
if (typeof btoa == "function") return btoa(module.exports.bytesToString(bytes));
for(var base64 = [], i = 0; i < bytes.length; i += 3) {
var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
@ -38,8 +36,6 @@ module.exports.bytesToBase64 = function(bytes) {
// Convert a base-64 string to a byte array
module.exports.base64ToBytes = function(base64) {
// Use browser-native function if it exists
if (typeof atob == "function") return module.exports.stringToBytes(atob(base64));
// Remove non-base-64 characters
base64 = base64.replace(/[^A-Z0-9+\/]/ig, "");

Loading…
Cancel
Save