Пример #1
0
        public Snowflake(string input)
        {
            OriginalID = input;
            Byte[] bytesVer = Bytes.ConvertToByteArray(input, Encoding.ASCII);
            AsBytes  = bytesVer;
            AsString = bytesVer.ToString();
            AsUint64 = UInt64.Parse(input);
            byte[] results = new byte[42];
            int    index   = Array.IndexOf(AsBytes, (byte)0x0);

            Array.Copy(AsBytes, index, results, 0, 42);
            float epochTime = (float)Bytes.ByteArrayToDecimal(results, 0) + Constants.DISCORDEPOCH;

            TimeStampAsEpoch = epochTime;
            DateTime dateTime = DateTime.Parse(epochTime.ToString());

            TimeStamp = dateTime;
        }