From b1f50d936412320b7d8800352fc0768cb0b9b029 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Tue, 14 Feb 2023 23:08:38 +0000 Subject: [PATCH] hash-to-curve: bls examples --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c5225d..580c2b2 100644 --- a/README.md +++ b/README.md @@ -473,8 +473,11 @@ Every curve has exported `hashToCurve` and `encodeToCurve` methods: import { hashToCurve, encodeToCurve } from '@noble/curves/secp256k1'; import { randomBytes } from '@noble/hashes/utils'; console.log(hashToCurve(randomBytes())); -console.log(hashToCurve(randomBytes(), { DST: 'custom' })); console.log(encodeToCurve(randomBytes())); + +import { bls12_381 } from '@noble/curves/bls12-381'; +bls12_381.G1.hashToCurve(randomBytes(), { DST: 'another' }); +bls12_381.G2.hashToCurve(randomBytes(), { DST: 'custom' }); ``` If you need low-level methods from spec: