Some functions
The functions in server!
For instance:
Path Info:
Current Page Path:/lessons/Lesson14
Root Path:
WWW Path:C:\www\bin\wwwroot\
APP Path:C:\www\bin\
Original string:世界,你好!联系人:
Base64 function:
5LiW55WM77yM5L2g5aW977yB6IGU57O75Lq677ya
世界,你好!联系人:
function UrlEncode(const svar: string): string; | Name%3D%E5%BC%A0%E4%B8%89%26Friends%3D%E6%9D%8E%E5%9B%9B%2C%E7%8E%8B%E4%BA%94
function UrlDecode(U: string): string; | Name=张三&Friends=李四,王五
Hash64 function(murmur method):
1130443198899073470
GetTickCount:
941926304
MD5:
228A37C4A96D1CDC1659B9E2BF4B0000
QueryPerformanceFrequency:
2435732
QueryPerformanceCounter:
259905991618221
Snow Algorithm from Facebook:
function SnowInit(const ACurMachineID: Word): Boolean;
Init current server id, It will be execute once.
function SnowID: Int64;
Generate ID:
6287097399756197889
6287097399756197890
File Functions:
FileName:C:\www\bin\wwwroot\\lessons\Lesson14\index.pp
FilePath:C:\www\bin\wwwroot\\lessons\Lesson14\
FileAge:1319001239
FileAgeToDateTime:43585.48386574
FileSize:5885
Time Functions:
function NowUTC: TDateTime; | 45571.19956504 | 2024-10-06 04:47:22
function UnixTimeUTC: Int64; | 1728190042
Now:45571.53289837
function DateTimeToUnixTime(const AValue: TDateTime): Int64; | 1728218842
function UnixTimeToDateTime(const UnixTime: Int64): TDateTime; | 45571.53289352
SystemInfo Functions:
function GetCurrentThreadID: Cardinal; | 154432
function GetTickCount64: Int64; | 106705495968
function Random32(max: cardinal): cardinal; | 3595744648
function Rand64(const IsUInt64: Boolean = False): Int64; | CD6379D0A4492515
function GUIDToString(const guid: TGUID): string;
function NewGuid: TGUID; | {88DB6000-5C37-4B5F-9EA5-3FB8A6EBC41F}
function NewGuidStr(IsLowerCase: Boolean = False): string; | {10bc997e-9c5b-42f2-ac04-96eca1252094}
Original string:世界,你好!
function GzCompress(var DataRawByteString: AnsiString; Compress: boolean): AnsiString;
Compressed:H4sIAAAAAAAAAAESAO3/5LiW55WM77yM5L2g5aW977yBCqgw+hIAAAA=
Uncompressed:世界,你好!
function DeflateCompress(var DataRawByteString: AnsiString; Compress: boolean): AnsiString;
Compressed:ARIA7f/kuJbnlYzvvIzkvaDlpb3vvIE=
Uncompressed:世界,你好!
function ZLibCompress(var DataRawByteString: AnsiString; Compress: boolean): AnsiString;
Compressed:eAEBEgDt/+S4lueVjO+8jOS9oOWlve+8gX3aDSY=
Uncompressed:世界,你好!