Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Calculated SHA-1 hash of given text.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Hash | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
text | The text to process. | "Hello World" | |
Flags | Various flags you can combine by addition. Pass 1 for getting result Base64 encoded instead of Hex encoded. Pass 2 if input data is Hex encoded and plugin should decode it first. Pass 8 for base64URL encoding. (new in v10.3) |
0 | Optional |
Returns SHA-256 hash.
Calculate hash of password:
MBS( "Hash.SHA1"; $password )
Calculate empty hash:
MBS("Hash.SHA1"; "")
Example result: DA39A3EE5E6B4B0D3255BFEF95601890AFD80709
Calculate empty hash as Base64:
MBS("Hash.SHA1"; ""; 1)
Example result: "2jmj7l5rSw0yVb/vlWAYkK/YBwk="
Calculate for two similar texts:
MBS("Hash.SHA1"; "Franz jagt im komplett verwahrlosten Taxi quer durch Bayern")
Example result: 68AC906495480A3404BEEE4874ED853A037A7A8F
Calculate for two similar texts:
MBS("Hash.SHA1"; "Frank jagt im komplett verwahrlosten Taxi quer durch Bayern")
Example result: D8E8ECE39C437E515AA8997C1A1E94F1ED2A0E62
Encode Password like in PHP:
# original in PHP:
#
# $nonce_date_pwd = pack("A*",$nonce) . pack("A*",$CREATIONDATE) . pack("H*", sha1($password));
# $PASSWORDDIGEST = base64_encode( pack('H*', sha1($nonce_date_pwd)));
#
# in FileMaker:
#
# you can use Hash.RandomHexString to make your Nonce.
#
Set Variable [ $NonceHexEncoded ; Wert: MBS("Text.EncodeToHex"; Password Digest::Nonce) ]
Set Variable [ $CreationDateHexEncoded ; Wert: MBS("Text.EncodeToHex"; Password Digest::CreationDate) ]
Set Variable [ $PasswordHashHexEncoded ; Wert: MBS( "Hash.SHA1"; Password Digest::Password; 0 ) ]
Set Variable [ $Input ; Wert: $NonceHexEncoded & $CreationDateHexEncoded & $PasswordHashHexEncoded ]
# build hash by decoding from Hex, doing SHA1 and encode back to Base64
Set Variable [ $PasswordDigest ; Wert: MBS( "Hash.Digest"; "SHA1"; "hex"; $input; ""; "Base64"; "" ) ]
Set Field [ Password Digest::PasswordDigest ; $PasswordDigest ]
FileMaker 16 vs. Plugin:
# MBS Plugin:
MBS( "Hash.SHA1"; "Hello World")
# Same via FileMaker 16 native:
HexEncode( CryptDigest ( "Hello World"; "SHA1" ))
Created 18th August 2014, last changed 20th June 2020
Hash.RandomString - Hash.SHA1.HMAC
Feedback: Report problem or ask question.