Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Hash.MD5.HMAC
Returns the a MD5 HMAC based on the key and the data string.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Hash | 4.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "Hash.MD5.HMAC"; key; data { ; Flags } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
key | The key text to use. | "Hello" | |
data | The data text to use. | "World" | |
Flags | Various flags you can combine by addition. Pass 1 for getting result Base64 encoded instead of Hex encoded. Pass 2 if key is Hex encoded and plugin should decode it first. Pass 4 if data is hex encoded and plugin should decode it first. Pass 8 for base64URL encoding. (new in v10.3) |
0 | Optional |
Result
Returns the hash string.
Description
Returns the a MD5 HMAC based on the key and the data string.Keyed-Hash Message Authentication Code is a way to add salt to a hash for more security.
Please be aware that text can result in different hashes if it contains line endings. You may want to make sure that line endings are right with the Text.ReplaceNewline function before you compare hashes to results in other development tools. FileMaker uses Mac line endings by default and most examples for Javascript use Unix line endings.
Examples
Hash empty string
MBS( "Hash.MD5.HMAC"; ""; "" )
Example result: 74E6F7298A9C2D168935F58C001BAD88
Hash a test string
MBS( "Hash.MD5.HMAC"; "key"; "The quick brown fox jumps over the lazy dog")
Example result: 80070713463E7749B90C2DC24911E275
FileMaker 16 vs. Plugin:
# MBS Plugin:
MBS( "Hash.MD5.HMAC"; "Key"; "Data")
# Same via FileMaker 16 native:
HexEncode( CryptAuthCode ( "Data" ; "MD5" ; "Key" ))
See also
Release notes
- Version 10.3
- Added option for Base64URL encoding to Hash.MD5, Hash.MD5.HMAC, Hash.SHA1, Hash.SHA1.HMAC, Hash.SHA256, Hash.SHA256.HMAC, Hash.SHA512 and Hash.SHA512.HMAC functions.
Blog Entries
- MBS FileMaker Plugin, version 10.3pr1
- Comparing Base Elements Plugin to MBS FileMaker Plugin
- MBS FileMaker Plugin, version 6.0pr7
- MBS Filemaker Plugin, version 4.0pr4
This function is free to use.
Created 18th August 2014, last changed 22nd May 2020