Remove deprecated utils functions

This commit is contained in:
Franck Royer 2022-03-25 14:24:48 +11:00
parent c4d779d1db
commit a915acfcda
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 1 additions and 23 deletions

View File

@ -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. - **Breaking**: Removed `equalByteArrays`, use `uint8arrays/equals` instead.
See changes in `eth-pm` example. See changes in `eth-pm` example.
- **Breaking**: Removed deprecated utils functions.
## [0.19.2] - 2022-03-21 ## [0.19.2] - 2022-03-21

View File

@ -1,18 +1,5 @@
import { keccak256, Message } from "js-sha3"; 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. * Convert input to a byte array.
*/ */
@ -28,16 +15,6 @@ export function hexToBytes(hex: string | Uint8Array): Uint8Array {
return hex; 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). * Convert byte array to hex string (no `0x` prefix).
*/ */