Skip to main content
@tevm/voltaire
@tevm/voltaire / crypto/Ripemd160

crypto/Ripemd160

Variables

HEX_SIZE

const HEX_SIZE: 40 = 40
Defined in: src/crypto/Ripemd160/constants.js:28 Size of RIPEMD160 hash in hex characters (without 0x prefix)

See

https://voltaire.tevm.sh/crypto for crypto documentation

Since

0.0.0

Throws

Example

import { HEX_SIZE } from './crypto/Ripemd160/index.js';
console.log(HEX_SIZE); // 40

Ripemd160

const Ripemd160: (input) => Ripemd160Hash & object = Ripemd160Hash
Defined in: src/crypto/Ripemd160/Ripemd160.js:53

Type Declaration

from()
from: (input) => Ripemd160Hash
Hash input with RIPEMD160 (constructor pattern) Auto-detects input type and hashes accordingly:
  • Uint8Array: hash directly
  • string: UTF-8 encode then hash
Parameters
input
Data to hash string | Uint8Array<ArrayBufferLike>
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto/ripemd160 for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160Hash } from './crypto/Ripemd160/index.js';

const hash1 = Ripemd160Hash.from("hello");           // String
const hash2 = Ripemd160Hash.from(uint8array);        // Bytes
fromHex()
fromHex: (hex) => Ripemd160Hash = hashHex
Compute RIPEMD160 hash of hex string (without 0x prefix)
Parameters
hex
string Hex string (with or without 0x prefix)
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hashHex("0xdeadbeef");
console.log(hash.length); // 20
fromString()
fromString: (str) => Ripemd160Hash = hashString
Compute RIPEMD160 hash of UTF-8 string
Parameters
str
string Input string
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hashString("hello");
console.log(hash.length); // 20
hash()
hash: (data) => Ripemd160Hash
Compute RIPEMD160 hash (20 bytes)
Parameters
data
Input data (Uint8Array or string) string | Uint8Array<ArrayBufferLike>
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hash(new Uint8Array([1, 2, 3]));
console.log(hash.length); // 20
hashHex()
hashHex: (hex) => Ripemd160Hash
Compute RIPEMD160 hash of hex string (without 0x prefix)
Parameters
hex
string Hex string (with or without 0x prefix)
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hashHex("0xdeadbeef");
console.log(hash.length); // 20
hashString()
hashString: (str) => Ripemd160Hash
Compute RIPEMD160 hash of UTF-8 string
Parameters
str
string Input string
Returns
Ripemd160Hash 20-byte hash
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hashString("hello");
console.log(hash.length); // 20
HEX_SIZE
HEX_SIZE: number
Size of RIPEMD160 hash in hex characters (without 0x prefix)
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { HEX_SIZE } from './crypto/Ripemd160/index.js';
console.log(HEX_SIZE); // 40
SIZE
SIZE: number
Size of RIPEMD160 hash in bytes (160 bits)
See
https://voltaire.tevm.sh/crypto for crypto documentation
Since
0.0.0
Throws
Example
import { SIZE } from './crypto/Ripemd160/index.js';
console.log(SIZE); // 20

Deprecated

Use Ripemd160Hash instead Ripemd160 alias maintained for backward compatibility

SIZE

const SIZE: 20 = 20
Defined in: src/crypto/Ripemd160/constants.js:14 Size of RIPEMD160 hash in bytes (160 bits)

See

https://voltaire.tevm.sh/crypto for crypto documentation

Since

0.0.0

Throws

Example

import { SIZE } from './crypto/Ripemd160/index.js';
console.log(SIZE); // 20

Functions

from()

from(input): Ripemd160Hash
Defined in: src/crypto/Ripemd160/from.js:24 Hash input with RIPEMD160 (constructor pattern) Auto-detects input type and hashes accordingly:
  • Uint8Array: hash directly
  • string: UTF-8 encode then hash

Parameters

input
Data to hash string | Uint8Array<ArrayBufferLike>

Returns

Ripemd160Hash 20-byte hash

See

https://voltaire.tevm.sh/crypto/ripemd160 for crypto documentation

Since

0.0.0

Throws

Example

import { Ripemd160Hash } from './crypto/Ripemd160/index.js';

const hash1 = Ripemd160Hash.from("hello");           // String
const hash2 = Ripemd160Hash.from(uint8array);        // Bytes

hash()

hash(data): Ripemd160Hash
Defined in: src/crypto/Ripemd160/hash.js:19 Compute RIPEMD160 hash (20 bytes)

Parameters

data
Input data (Uint8Array or string) string | Uint8Array<ArrayBufferLike>

Returns

Ripemd160Hash 20-byte hash

See

https://voltaire.tevm.sh/crypto for crypto documentation

Since

0.0.0

Throws

Example

import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hash(new Uint8Array([1, 2, 3]));
console.log(hash.length); // 20

hashHex()

hashHex(hex): Ripemd160Hash
Defined in: src/crypto/Ripemd160/hashHex.js:19 Compute RIPEMD160 hash of hex string (without 0x prefix)

Parameters

hex
string Hex string (with or without 0x prefix)

Returns

Ripemd160Hash 20-byte hash

See

https://voltaire.tevm.sh/crypto for crypto documentation

Since

0.0.0

Throws

Example

import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hashHex("0xdeadbeef");
console.log(hash.length); // 20

hashString()

hashString(str): Ripemd160Hash
Defined in: src/crypto/Ripemd160/hashString.js:19 Compute RIPEMD160 hash of UTF-8 string

Parameters

str
string Input string

Returns

Ripemd160Hash 20-byte hash

See

https://voltaire.tevm.sh/crypto for crypto documentation

Since

0.0.0

Throws

Example

import { Ripemd160 } from './crypto/Ripemd160/index.js';
const hash = Ripemd160.hashString("hello");
console.log(hash.length); // 20

References

Ripemd160Hash

Re-exports Ripemd160Hash