Ejemplo n.º 1
0
        public void CreateMd5_PythonExample_EncodesAsExpected()
        {
            // See https://docs.python.org/3/library/uuid.html#example
            var guid = GuidFactory.CreateMd5(GuidNamespaces.Dns,
                                             new UTF8Encoding(encoderShouldEmitUTF8Identifier: false).GetBytes("python.org"));

            Assert.Equal("6fa459ea-ee8a-3ca4-894e-db77e160355e", guid.ToString("D"));
        }
Ejemplo n.º 2
0
        public void CreateMd5_OsspExample_EncodesAsExpected()
        {
            // See https://github.com/sean-/ossp-uuid/blob/master/perl/uuid.ts#L74
            var guid = GuidFactory.CreateMd5(GuidNamespaces.Url,
                                             new UTF8Encoding(encoderShouldEmitUTF8Identifier: false).GetBytes("http://www.ossp.org/"));

            Assert.Equal("02d9e6d5-9467-382e-8f9b-9300a64ac3cd", guid.ToString("D"));
        }
Ejemplo n.º 3
0
        public void CreateMd5_RfcExample_EncodesAsExpected()
        {
            // See https://www.rfc-editor.org/errata/eid1352
            var guid = GuidFactory.CreateMd5(GuidNamespaces.Dns,
                                             new UTF8Encoding(encoderShouldEmitUTF8Identifier: false).GetBytes("www.widgets.com"));

            Assert.Equal("3d813cbb-47fb-32ba-91df-831e1593ac29", guid.ToString("D"));
        }