removed byte formatter methods

This commit is contained in:
Fabian Vogelsteller 2015-05-12 11:02:46 +02:00
parent 6fd17d99be
commit d1e1206e5a
7 changed files with 8 additions and 164 deletions

52
dist/web3-light.js vendored
View File

@ -1163,55 +1163,6 @@ var toAddress = function (address) {
return '0x' + padLeft(toHex(address).substr(2), 40); return '0x' + padLeft(toHex(address).substr(2), 40);
}; };
/**
* Transforms given string to valid bytes-length string with 0x prefix
*
* @method toLeftPaddedBytes
* @param {String} string
* @return {String} formatted string
*/
var toLeftPaddedBytes = function (string, bytes) {
var reg = new RegExp('^[0-9a-f]{'+ bytes * 2 +'}$');
if (reg.test(string)) {
return '0x' + string;
}
return '0x' + padLeft(string.substr(2), bytes*2);
};
/**
* Transforms given string to valid 8 bytes-length string with 0x prefix
*
* @method to8Bytes
* @param {String} string
* @return {String} formatted string
*/
var to8Bytes = function (string) {
return toLeftPaddedBytes(string, 8)
};
/**
* Transforms given string to valid 32 bytes-length string with 0x prefix
*
* @method to32Bytes
* @param {String} string
* @return {String} formatted string
*/
var to32Bytes = function (string) {
return toLeftPaddedBytes(string, 32)
};
/**
* Transforms given string to valid 64 bytes-length string with 0x prefix
*
* @method to64Bytes
* @param {String} string
* @return {String} formatted string
*/
var to64Bytes = function (string) {
return toLeftPaddedBytes(string, 64)
};
/** /**
* Returns true if object is BigNumber, otherwise false * Returns true if object is BigNumber, otherwise false
@ -1311,9 +1262,6 @@ module.exports = {
toBigNumber: toBigNumber, toBigNumber: toBigNumber,
toTwosComplement: toTwosComplement, toTwosComplement: toTwosComplement,
toAddress: toAddress, toAddress: toAddress,
to8Bytes: to8Bytes,
to32Bytes: to32Bytes,
to64Bytes: to64Bytes,
isBigNumber: isBigNumber, isBigNumber: isBigNumber,
isStrictAddress: isStrictAddress, isStrictAddress: isStrictAddress,
isAddress: isAddress, isAddress: isAddress,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

52
dist/web3.js vendored
View File

@ -1163,55 +1163,6 @@ var toAddress = function (address) {
return '0x' + padLeft(toHex(address).substr(2), 40); return '0x' + padLeft(toHex(address).substr(2), 40);
}; };
/**
* Transforms given string to valid bytes-length string with 0x prefix
*
* @method toLeftPaddedBytes
* @param {String} string
* @return {String} formatted string
*/
var toLeftPaddedBytes = function (string, bytes) {
var reg = new RegExp('^[0-9a-f]{'+ bytes * 2 +'}$');
if (reg.test(string)) {
return '0x' + string;
}
return '0x' + padLeft(string.substr(2), bytes*2);
};
/**
* Transforms given string to valid 8 bytes-length string with 0x prefix
*
* @method to8Bytes
* @param {String} string
* @return {String} formatted string
*/
var to8Bytes = function (string) {
return toLeftPaddedBytes(string, 8)
};
/**
* Transforms given string to valid 32 bytes-length string with 0x prefix
*
* @method to32Bytes
* @param {String} string
* @return {String} formatted string
*/
var to32Bytes = function (string) {
return toLeftPaddedBytes(string, 32)
};
/**
* Transforms given string to valid 64 bytes-length string with 0x prefix
*
* @method to64Bytes
* @param {String} string
* @return {String} formatted string
*/
var to64Bytes = function (string) {
return toLeftPaddedBytes(string, 64)
};
/** /**
* Returns true if object is BigNumber, otherwise false * Returns true if object is BigNumber, otherwise false
@ -1311,9 +1262,6 @@ module.exports = {
toBigNumber: toBigNumber, toBigNumber: toBigNumber,
toTwosComplement: toTwosComplement, toTwosComplement: toTwosComplement,
toAddress: toAddress, toAddress: toAddress,
to8Bytes: to8Bytes,
to32Bytes: to32Bytes,
to64Bytes: to64Bytes,
isBigNumber: isBigNumber, isBigNumber: isBigNumber,
isStrictAddress: isStrictAddress, isStrictAddress: isStrictAddress,
isAddress: isAddress, isAddress: isAddress,

4
dist/web3.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/web3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -363,55 +363,6 @@ var toAddress = function (address) {
return '0x' + padLeft(toHex(address).substr(2), 40); return '0x' + padLeft(toHex(address).substr(2), 40);
}; };
/**
* Transforms given string to valid bytes-length string with 0x prefix
*
* @method toLeftPaddedBytes
* @param {String} string
* @return {String} formatted string
*/
var toLeftPaddedBytes = function (string, bytes) {
var reg = new RegExp('^[0-9a-f]{'+ bytes * 2 +'}$');
if (reg.test(string)) {
return '0x' + string;
}
return '0x' + padLeft(string.substr(2), bytes*2);
};
/**
* Transforms given string to valid 8 bytes-length string with 0x prefix
*
* @method to8Bytes
* @param {String} string
* @return {String} formatted string
*/
var to8Bytes = function (string) {
return toLeftPaddedBytes(string, 8)
};
/**
* Transforms given string to valid 32 bytes-length string with 0x prefix
*
* @method to32Bytes
* @param {String} string
* @return {String} formatted string
*/
var to32Bytes = function (string) {
return toLeftPaddedBytes(string, 32)
};
/**
* Transforms given string to valid 64 bytes-length string with 0x prefix
*
* @method to64Bytes
* @param {String} string
* @return {String} formatted string
*/
var to64Bytes = function (string) {
return toLeftPaddedBytes(string, 64)
};
/** /**
* Returns true if object is BigNumber, otherwise false * Returns true if object is BigNumber, otherwise false
@ -511,9 +462,6 @@ module.exports = {
toBigNumber: toBigNumber, toBigNumber: toBigNumber,
toTwosComplement: toTwosComplement, toTwosComplement: toTwosComplement,
toAddress: toAddress, toAddress: toAddress,
to8Bytes: to8Bytes,
to32Bytes: to32Bytes,
to64Bytes: to64Bytes,
isBigNumber: isBigNumber, isBigNumber: isBigNumber,
isStrictAddress: isStrictAddress, isStrictAddress: isStrictAddress,
isAddress: isAddress, isAddress: isAddress,