Comparing version 0.0.70 to 0.0.71
@@ -951,9 +951,7 @@ import { i128 } from './i128'; | ||
var result = ''; | ||
var it = this.clone(); | ||
if (radix == 16) { | ||
let shift: i32 = 124 - (u128.clz(it) & ~3); | ||
let shift: i32 = 124 - (u128.clz(this) & ~3); | ||
while (shift >= 0) { | ||
// @ts-ignore | ||
it >>= shift; | ||
result = result.concat(HEX_CHARS.charAt(<i32>(it.lo & 15))); | ||
result += HEX_CHARS.charAt(<i32>((this >> shift).lo & 15)); | ||
shift -= 4; | ||
@@ -960,0 +958,0 @@ } |
@@ -660,9 +660,7 @@ import { i128 } from './i128'; | ||
var result = ''; | ||
var it = this.clone(); | ||
if (radix == 16) { | ||
let shift: i32 = 252 - (u256.clz(it) & ~3); | ||
let shift: i32 = 252 - (u256.clz(this) & ~3); | ||
while (shift >= 0) { | ||
// @ts-ignore | ||
it >>= shift; | ||
result = result.concat(HEX_CHARS.charAt(<i32>(it.lo1 & 15))); | ||
result += HEX_CHARS.charAt(<i32>((this >> shift).lo1 & 15)); | ||
shift -= 4; | ||
@@ -669,0 +667,0 @@ } |
@@ -695,5 +695,5 @@ import { check } from "./system"; | ||
export function modExp(base: U256, exp: U256, mod: U256): U256 { | ||
const rawBase = base.pack(); | ||
const rawExp = exp.pack(); | ||
const rawMod = mod.pack(); | ||
const rawBase = Utils.hexToBytes(base.toString(16)); | ||
const rawExp = Utils.hexToBytes(exp.toString(16)); | ||
const rawMod = Utils.hexToBytes(mod.toString(16)); | ||
const rawResult = new Array<u8>(32); | ||
@@ -700,0 +700,0 @@ const ret = env.mod_exp(rawBase.dataStart, rawBase.length, rawExp.dataStart, rawExp.length, rawMod.dataStart, rawMod.length, rawResult.dataStart, rawResult.length) |
{ | ||
"name": "as-chain", | ||
"version": "0.0.70", | ||
"version": "0.0.71", | ||
"description": "chain module for assemblyscript", | ||
@@ -5,0 +5,0 @@ "main": "js/index.js", |
1574076
6659