Jump to content

Search the Community

Showing results for tags 'create guid'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. This is just a function I came up with in about 1 minute and thought I would share it with the community. It has no real practical use, so take it as something to learn from. #include <Constants.au3> MsgBox($MB_SYSTEMMODAl, '', CreateGUIDFromString('Some very simple string.')) MsgBox($MB_SYSTEMMODAl, '', CreateGUIDFromString('A GUID string.')) MsgBox($MB_SYSTEMMODAl, '', CreateGUIDFromString('1 chr')) ; #FUNCTION# ==================================================================================================================== ; Name ..........: CreateGUIDFromString ; Description ...: Convert a string to a valid GUID. ; Syntax ........: CreateGUIDFromString($sString) ; Parameters ....: $sString - A string value of any length. Depending on the length of the string, this function may ; return with succeeding zeros to pad the GUID to a length of 32 characters. ; Return values .: Success - GUID string ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func CreateGUIDFromString($sString) Local Const $CHR_COUNT = 1, $MAX_LENGTH = 32 Local $sGUID = '' For $i = 1 To $MAX_LENGTH $sGUID &= Hex(Asc(StringMid($sString, $i, $CHR_COUNT)), 2) Next Return StringRegExpReplace($sGUID, '([[:xdigit:]]{8})([[:xdigit:]]{4})([[:xdigit:]]{4})([[:xdigit:]]{4})([[:xdigit:]]{12})(?:[[:xdigit:]]{0,})', '\{\1-\2-\3-\4-\5\}') EndFunc ;==>CreateGUIDFromString
×
×
  • Create New...