Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

sha256 encryption

Featured Replies

  • Newbies

Anyone know if it is possible to generate sha256 encrypted text using Scriptmaster?

 

any response is highly appreciated.

Try this.

 

It takes the path to a file as a parameter and outputs the SHA-256 as a hexstring.

 

 

 

function: sha256

parameters: filepath  // path to file for which the digest will be created

 

 

import java.io.FileInputStream;

import java.security.MessageDigest;

import java.security.DigestInputStream

 

// MessageDigest md = MessageDigest.getInstance("MD5");

// MessageDigest md = MessageDigest.getInstance("SHA-512");

MessageDigest md = MessageDigest.getInstance("SHA-256");

 

InputStream is = new FileInputStream( filepath );

try {

  is = new DigestInputStream(is, md);

  // read stream to EOF as normal...

}

finally {

  is.close();

}

// for hex output

return new BigInteger(1,md.digest()).toString(16).padLeft(64, '0')

 

// for base 64 output (allows for SHA-512 in a FMP Textfield fully indexed)

// return new sun.misc.BASE64Encoder().encode( md.digest() );

Re-reading this thread I stumbled upon the use of the word encryption.

 

To be clear:

 

SHA1, SHA224, SHA256, SHA384, SHA512 and MD5 are about checksums and not about encryption!

 

They are called "secure hash" or with the older term "message digest".

 

You use them to create tamper proof checksums of content.

 

For example, I use SHA-512 to find identical pictures. FileMaker can't compare container fields but it can find identical entries in text fields. A hex encoded SHA-384 or a base64 encoded SHA-512 fit neatly in FMs 100 character index limit.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.