ScriptSpot

Forum topic · General Scripting

HOW TO ENCODE STRING TO NUMBER AND DECODE NUMBER TO STRING

By alexnguyen · 2017-08-30

Description

hello my name is Nam , i com from vietnam , i am a newbie in maxscript , i found a simple script to encode string to number , but i dont know how to decode from number to string , can you help me thank you very much

diachimac = ((((dotNetClass "System.Net.NetworkInformation.NetworkInterface").GetAllNetworkInterfaces())[1].getPhysicalAddress()).tostring())

encodingString = "abcdefghijklmnopqrstuvwxyz1234567890"
fn encodeString stringToEncode =
(
encodedSysID = ""
for i = 1 to stringToEncode.count do
(
charIndex = findstring encodingString stringToEncode[i]
encodedSysID += charIndex as string +" "
)
return encodedSysID
)

encodeString diachimac

Comments (1)