Add to Favorites    Make Home Page 8778 Online  
 Language Categories  
 Our Services  

Home » ASP Home » Math Home » GUID Generator - 26 Characters

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title GUID Generator - 26 Characters
Description The purpose is to use in generating e-commerce Order numbers, memberids etc MS Site server commerce uses 26-Charcter Unique ID for Order number and membership numbers. I tried to generate the same kinda numbers using plain ASP. ServerObjects.com provides a object for generating GUID(globally unique ID) from ASP page. But it produces 38 character long and is hard to read(uses only hex). Instead, I compressed the GUID to 26 characters using alphabets and numbers For ex GUID maker returns {E06019F5-A313-11D4-902B00A0C9ECF1DF} After conversion it looks like T1H1KUE32D8U941C02HDKS7IST
Category ASP » Math
Hits 379792
Code Select and Copy the Code
'Generate 26 charcter Unique ID Function GetUniqueId() Dim strUniqueID, GUID Dim iCount, strBinary, strUniqueChar 'Set GUID = Server.CreateObject("GuidMak ' r.GUID") Set GUID = Server.CreateObject("GuidMakr.GUID") strUniqueID = Trim(GUID.GetGUID) 'Returns something like E06019F5A31311D4902B00A0C9ECF1DF 'Remove -, { in the generated number strUniqueID = Right(Left(Replace(strUniqueID, "-", ""), 33), 32) 'Convert to binary strBinary = "" For iCount = 1 To 32 strBinary = strBinary & ConvertHexToBin(Mid(strUniqueID, iCount, 1)) Next 'make it to 130 bit number strBinary = strBinary & "00" 'Regroup binary into 5bits and convert t ' o number For iCount = 1 To 130 Step 5 strNo = (CInt(Mid(strBinary, iCount, 1)) * 16) + (CInt(Mid(strBinary, iCount + 1, 1)) * 8) + (CInt(Mid(strBinary, iCount + 2, 1)) * 4) + (CInt(Mid(strBinary, iCount + 3, 1)) * 2) + (CInt(Mid(strBinary, iCount + 4, 1))) 'If greater than 9 convert the number To alphabet. Where A maps to 10 If strNo > 9 Then strChar = Chr(strNo + 56) Else strChar = CStr(strNo) End If strUniqueChar = strUniqueChar & strChar Next GetUniqueId = strUniqueChar 'Something like T1H1KUE32D8U941C02HDKS7IST End Function Function ConvertHexToBin(strHex) Dim strBin Select Case UCase(strHex) Case "0" strBin = "0000" Case "1" strBin = "0001" Case "2" strBin = "0010" Case "3" strBin = "0011" Case "4" strBin = "0100" Case "5" strBin = "0101" Case "6" strBin = "0110" Case "7" strBin = "0111" Case "8" strBin = "1000" Case "9" strBin = "1001" Case "A" strBin = "1010" Case "B" strBin = "1011" Case "C" strBin = "1100" Case "D" strBin = "1101" Case "E" strBin = "1110" Case "F" strBin = "1111" Case Else strBin = "" End Select ConvertHexToBin = strBin End Function

Related Source Codes

Script Name Author
��������������������� VyomWorld
Resistor color code reader A.Chermarajan.
Telephone Directory dhivya
card swapping game (Mini Project) nityanand
simple hangman-pascalsource Seabert
college dirtectory (Mini Project) msridhar
Poll Application John van Meter
ASP Daily Hit Counter. Tejaskumar Gandhi
To avoid null in asp environment using sql Sami
Maklumbalas webmaster
poll John van Meter
EasyASP Template Engine. TjoekBezoer
Basic Calculator using HTML & Javascript. Patrick M. D Souza
What servers support ASP ? VyomWorld
What is ASP? VyomWorld

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=286


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review