ethereum-web-token
Version:
EWT bundles Ethereum function-calls into [JWT](https://jwt.io/)-like tokens. It simplifies the use of ECDSA signatures for webapps and the development of [Smart Oracles](https://github.com/codius/codius/wiki/Smart-Oracles:-A-Simple,-Powerful-Approach-to-S
13 lines (10 loc) • 397 B
JavaScript
;Object.defineProperty(exports, "__esModule", { value: true });exports.sliceData = sliceData;function sliceData(_data) {
if (!_data || !_data.length) {
return [];
}
var data = _data.substr(0, 2) === '0x' ? _data.substr(2) : _data;
if (data.length % 64) {
throw new Error('Invalid data length (not mod 64) passed to sliceData');
}
return data.match(/.{1,64}/g);
}