Brian Dunning's FileMaker Custom Functions

HexUUIDToNum_cf ( _uuid )

Converts a text based Get (UUID) to a 41 digit number

  Average rating: 3.0 (1 vote) Log in to vote

Christopher Gauntt   Christopher Gauntt
Cordega Solutions
https://cordega.com

Share on Facebook Share on Twitter

  Sample input:
HexUUIDToNum_cf ("DBB8EE4A-01F8-5B41-B598-4663A715E569")

HexUUIDToNum_cf ("00000000-0000-0000-0000-000000000000")

HexUUIDToNum_cf ("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF")
  Sample output:
12920611468758474091732647040380614833691

10000000001000010000100001000000000000001

13402823670209394634733747074317682114551

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This function concatenates the five segments of a Get (UUID) text-based hexadecimal, converts it into a fixed length decimal and then adds a preset value to make sure the result is a uniform 41 digit number that still functions as a UUID, with no leading or trailing zeros.

This is intentional for two reason:
1. the forced 1 at the end will prevent a scientific notation from returning if there happen to be too many zeros in a row at the end.
2. the forced 1 at the beginning will guarantee a fixed length value, which may be important when switching a system over from a serial number based uid to a numeric uuid

Feedback welcome.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.