Files
common/docs/u8a.md
T
Jaco Greeff 5d0a7231dc Fix alias links (#34)
* Fix alias links

* Update alias links

* Update generated docs
2017-12-01 20:34:51 +01:00

801 B

u8a

Utility methods to convert to and from Uint8Array objects

u8aFromBuffer

Creates a Uint8Array value from a Buffer object. (alias of bufferToU8a)

u8aFromBuffer (value?: Buffer): number

u8aToBuffer

Creates a Buffer object from a hex string.

u8aToBuffer (value?: UInt8Array): Buffer

null inputs returns an empty Buffer result. UInt8Array input values return the actual bytes value converted to a Buffer. Anything that is not a UInt8Array throws an error.

import { u8aToBuffer } from '@polkadot/util';

console.log('Buffer', u8aToBuffer('0x123480001f'));