0
点赞
收藏
分享

微信扫一扫

d的sha6转大整

可直接构造,不用先转为串:

import std.digest.sha, std.bigint;

ubyte[32] hash = sha256Of(whatever);
auto t = BigInt(false, hash[]); // sign + magnitude

这样不行:

auto t = BigInt("2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824")

这样可以:

auto t = BigInt("0x" ~"2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824")

举报

相关推荐

0 条评论