mirror of https://github.com/waku-org/js-waku.git
Remove deprecated utils functions
This commit is contained in:
parent
c4d779d1db
commit
a915acfcda
|
@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
- **Breaking**: Removed `equalByteArrays`, use `uint8arrays/equals` instead.
|
||||
See changes in `eth-pm` example.
|
||||
- **Breaking**: Removed deprecated utils functions.
|
||||
|
||||
## [0.19.2] - 2022-03-21
|
||||
|
||||
|
|
|
@ -1,18 +1,5 @@
|
|||
import { keccak256, Message } from "js-sha3";
|
||||
|
||||
/**
|
||||
* Convert input to a Buffer.
|
||||
*
|
||||
* @deprecated Use `hexToBytes` instead.
|
||||
*/
|
||||
export function hexToBuf(hex: string | Buffer | Uint8Array): Buffer {
|
||||
if (typeof hex === "string") {
|
||||
return Buffer.from(hex.replace(/^0x/i, ""), "hex");
|
||||
} else {
|
||||
return Buffer.from(hex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert input to a byte array.
|
||||
*/
|
||||
|
@ -28,16 +15,6 @@ export function hexToBytes(hex: string | Uint8Array): Uint8Array {
|
|||
return hex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert input to hex string (no `0x` prefix).
|
||||
*
|
||||
* @deprecated Use `bytesToHex` instead.
|
||||
*/
|
||||
export function bufToHex(buf: Uint8Array | Buffer | ArrayBuffer): string {
|
||||
const _buf = Buffer.from(buf);
|
||||
return _buf.toString("hex");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert byte array to hex string (no `0x` prefix).
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue