https://github.com/edjcase/motoko_hmac
Motoko library for HMAC generation and verification
https://github.com/edjcase/motoko_hmac
Last synced: 5 months ago
JSON representation
Motoko library for HMAC generation and verification
- Host: GitHub
- URL: https://github.com/edjcase/motoko_hmac
- Owner: edjCase
- License: apache-2.0
- Created: 2025-02-27T22:18:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-01T16:39:47.000Z (11 months ago)
- Last Synced: 2025-08-01T18:41:22.050Z (11 months ago)
- Language: Motoko
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HMAC library for Motoko
A fork of [herumi/ecdsa-motoko](https://github.com/herumi/ecdsa-motoko), providing HMAC-256 implementation.
## Original Project Credits
- **Author**: MITSUNARI Shigeo (herumi@nifty.com)
- **Original Repository**: https://github.com/herumi/ecdsa-motoko
## License
Apache 2.0 with LLVM Exception
This project is a fork of the original ECDSA implementation by MITSUNARI Shigeo, maintaining the same license.
## Installation
```bash
mops install hmac
```
To setup MOPS package manage, follow the instructions from the
[MOPS Site](https://j4mwm-bqaaa-aaaam-qajbq-cai.ic0.app/)
## API Reference
```motoko
// Generate HMAC digest
public func generate(
key : [Nat8], // Key for HMAC
msg : Iter.Iter, // Message to hash
algorithm : HashAlgorithm, // Hash algorithm to use
) : Blob // Returns HMAC digest as Blob
// Define available hash algorithms
public type HashAlgorithm = {
#sha256; // Standard SHA-256
#custom : (Iter.Iter) -> Blob; // Custom hash function
};
```
## Changes from Original
Adapted it to use for the MOPS package manager
## Original Project
If you'd like to support the original project:
- Original repository: https://github.com/herumi/ecdsa-motoko
- [GitHub Sponsor](https://github.com/sponsors/herumi)