@otplib/core 13.2.0 → 13.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,9 +54,9 @@ The `CryptoContext` class provides a unified interface for crypto operations:
|
|
|
54
54
|
|
|
55
55
|
```typescript
|
|
56
56
|
import { createCryptoContext } from "@otplib/core";
|
|
57
|
-
import {
|
|
57
|
+
import { crypto as plugin } from "@otplib/plugin-crypto-node";
|
|
58
58
|
|
|
59
|
-
const crypto = createCryptoContext(
|
|
59
|
+
const crypto = createCryptoContext(plugin);
|
|
60
60
|
|
|
61
61
|
// Async HMAC computation
|
|
62
62
|
const digest = await crypto.hmac("sha1", key, data);
|
|
@@ -74,9 +74,9 @@ The `Base32Context` class provides a unified interface for Base32 operations:
|
|
|
74
74
|
|
|
75
75
|
```typescript
|
|
76
76
|
import { createBase32Context } from "@otplib/core";
|
|
77
|
-
import {
|
|
77
|
+
import { base32 as plugin } from "@otplib/plugin-base32-scure";
|
|
78
78
|
|
|
79
|
-
const base32 = createBase32Context(
|
|
79
|
+
const base32 = createBase32Context(plugin);
|
|
80
80
|
|
|
81
81
|
// Encode binary data to Base32
|
|
82
82
|
const encoded = base32.encode(new Uint8Array([1, 2, 3]), { padding: false });
|