eosjs 文档(Numeric)

Numeric
枚举
KeyType
接口
Key
变量

base58Chars
base58Map
base64Chars
base64Map
privateKeyDataSize
publicKeyDataSize
ripemd160
signatureDataSize

函数

base58ToBinary
base64ToBinary
binaryToBase58
binaryToDecimal
convertLegacyPublicKey
convertLegacyPublicKeys
create_base58_map
create_base64_map
decimalToBinary
digestSuffixRipemd160
isNegative
keyToString
negate
privateKeyToString
publicKeyToString
signatureToString
signedBinaryToDecimal
signedDecimalToBinary
stringToKey
stringToPrivateKey
stringToPublicKey
stringToSignature

变量
<Const> base58Chars
const base58Chars = “123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz”;
定义于eosjs-numeric.ts:9
<Const> base58Map
const base58Map = create_base58_map();
定义于eosjs-numeric.ts:20
<Const> base64Chars
const base64Chars = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/”;
定义于eosjs-numeric.ts:10
<Const> base64Map
const base64Map = create_base64_map();
定义于eosjs-numeric.ts:31
<Const> privateKeyDataSize
export const privateKeyDataSize = 32;
定义于eosjs-numeric.ts:227
私钥数据大小,不包括类型字段。
<Const> publicKeyDataSize
export const publicKeyDataSize = 33;
定义于eosjs-numeric.ts:224
公钥数据大小,不包括类型字段。
<Const> ripemd160
const ripemd160 = require(“./ripemd”).RIPEMD160.hash as (a: Uint8Array) => ArrayBuffer;
定义于eosjs-numeric.ts:7
类型声明
(a: Uint8Array): ArrayBuffer
参数:

名称
类型

a
Uint8Array

返回:ArrayBuffer
<Const> signatureDataSize
export const signatureDataSize = 65;
定义于eosjs-numeric.ts:230
签名数据大小,不包括类型字段。
函数
base58ToBinary
base58ToBinary(size: number, s: string): Uint8Array
定义于eosjs-numeric.ts:132
将s中的无符号base-58数转换为bignum。
参数:

名称
类型
描述

size
number
bignum大小(字节)

s
string

返回:Uint8Array
base64ToBinary
base64ToBinary(s: string): Uint8Array
定义于eosjs-numeric.ts:182
将s中的无符号base-64数转换为bignum。
参数:

名称
类型

s
string

返回:Uint8Array
binaryToBase58
binaryToBase58(bignum: Uint8Array, minDigits?: number): string
定义于eosjs-numeric.ts:156
将bignum转换为base-58的数。
参数:

名称
类型
默认值
描述

bignum
Uint8Array

Default value minDigits
number
1
0填充的结果是许多数字

返回:string
binaryToDecimal
binaryToDecimal(bignum: Uint8Array, minDigits?: number): string
定义于eosjs-numeric.ts:97
将bignum转换为无符号十进制数。
参数:

名称
类型
默认值
描述

bignum
Uint8Array

Default value minDigits
number
1
0填充的结果是许多数字

返回:string
convertLegacyPublicKey
convertLegacyPublicKey(s: string): string
定义于eosjs-numeric.ts:312
如果密钥是旧格式(EOS前缀),则将其转换为新格式(PUB_K1_),保持其他格式不变。
参数:

名称
类型

s
string

返回:string
convertLegacyPublicKeys
convertLegacyPublicKeys(keys: string[]): string[]
定义于eosjs-numeric.ts:322
如果密钥是旧格式(EOS前缀),则将其转换为新格式(PUB_K1_),保持其他格式不变。
参数:

名称
类型

keys
string[]

返回:string[]
create_base58_map
create_base58_map(): number[]
定义于eosjs-numeric.ts:12
返回:number[]
create_base64_map
create_base64_map(): number[]
定义于eosjs-numeric.ts:22
返回:number[]
decimalToBinary
decimalToBinary(size: number, s: string): Uint8Array
定义于eosjs-numeric.ts:52
将s中的无符号十进制数转换为bignum。
参数:

名称
类型
描述

size
number
bignum大小(字节)

s
string

返回:Uint8Array
digestSuffixRipemd160
digestSuffixRipemd160(data: Uint8Array, suffix: string): ArrayBuffer
定义于eosjs-numeric.ts:238
参数:

名称
类型

data
Uint8Array

suffix
string

返回:ArrayBuffer
isNegative
isNegative(bignum: Uint8Array): boolean
定义于eosjs-numeric.ts:34
bignum是负数吗?
参数:

名称
类型

bignum
Uint8Array

返回:boolean
keyToString
keyToString(key: Key, suffix: string, prefix: string): string
定义于eosjs-numeric.ts:260
参数:

名称
类型

key
Key

suffix
string

prefix
string

返回:string
negate
negate(bignum: Uint8Array): void
定义于eosjs-numeric.ts:39
bignum转为负数。
参数:

名称
类型

bignum
Uint8Array

返回:void
privateKeyToString
privateKeyToString(key: Key): string
定义于eosjs-numeric.ts:339
将key转换为字符串(base-58)形式。
参数:

名称
类型

key
Key

返回:string
publicKeyToString
publicKeyToString(key: Key): string
定义于eosjs-numeric.ts:299
将key转换为字符串(base-58)形式。
参数:

名称
类型

key
Key

返回:string
signatureToString
signatureToString(signature: Key): string
定义于eosjs-numeric.ts:362
将signature转换为字符串(base-58)形式。
参数:

名称
类型

signature
Key

返回:string
signedBinaryToDecimal
signedBinaryToDecimal(bignum: Uint8Array, minDigits?: number): string
定义于eosjs-numeric.ts:119
将bignum转换为带符号的十进制数。
参数:

名称
类型
默认值
描述

bignum
Uint8Array

Default value minDigits
number
1
0填充的结果是许多数字

返回:string
signedDecimalToBinary
signedDecimalToBinary(size: number, s: string): Uint8Array
定义于eosjs-numeric.ts:76
将s中的带符号十进制数转换为bignum。
参数:

名称
类型
描述

size
number
bignum大小(字节)

s
string

返回:Uint8Array
stringToKey
stringToKey(s: string, type: KeyType, size: number, suffix: string): Key
定义于eosjs-numeric.ts:249
参数:

名称
类型

s
string

type
KeyType

size
number

suffix
string

返回:Key
stringToPrivateKey
stringToPrivateKey(s: string): Key
定义于eosjs-numeric.ts:327
将s中的密钥转换为二进制形式。
参数:

名称
类型

s
string

返回:Key
stringToPublicKey
stringToPublicKey(s: string): Key
定义于eosjs-numeric.ts:273
将s中的密钥转换为二进制形式。
参数:

名称
类型

s
string

返回:Key
stringToSignature
stringToSignature(s: string): Key
定义于eosjs-numeric.ts:348
将s中的密钥转换为二进制形式。
参数:

名称
类型

s
string

返回:Key
KeyType
枚举成员
k1
k1:= 0
定义于eosjs-numeric.ts:219
r1
r1:= 1
定义于eosjs-numeric.ts:220
Key
属性
data
data:Uint8Array
定义于eosjs-numeric.ts:235
type
type:KeyType
定义于eosjs-numeric.ts:234

上一篇:JSON-RPC

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理