Example #1
0
 /// <summary>
 ///		Constructs a Base64 value from a byte array.
 /// </summary>
 /// <param name="bytes">
 ///		Source bytes for the Base32 value.
 /// </param>
 /// <param name="format">
 ///		Specifies the Base64 encoding format.
 /// </param>
 public Base64(IList <byte> bytes, Base64Format format = Base64Format.RFC4648)
 {
     Bytes  = bytes as ImmutableCollection <byte> ?? new ImmutableCollection <byte>(bytes);
     Value  = Convert.ToBase64String(Bytes.ToArray());
     Format = format;
 }
 /// <summary>
 ///		Converts the Base32 value to byte array.
 /// </summary>
 /// <returns>
 ///		Returns byte array value presentation of the Base32 encoding.
 /// </returns>
 public byte[] ToByteArray()
 {
     return(Bytes.ToArray());
 }
Example #3
0
 private Base64(SerializationInfo info, StreamingContext context)
 {
     Bytes  = (ImmutableCollection <byte>)info.GetValue("B", typeof(ImmutableCollection <byte>));
     Format = (Base64Format)info.GetValue("F", typeof(Base64Format));
     Value  = Convert.ToBase64String(Bytes.ToArray());
 }