using System.Text;

namespace WBP_Office_Vascular_API_Demo_Customer {

    internal class PrivateFunction {

        /// <summary>
        /// Byte轉字串
        /// </summary>
        /// <param name="p"></param>
        /// <param name="Delimiter"></param>
        /// <returns></returns>
        internal static string ByteToHexString(byte[] p, string Delimiter) {
            StringBuilder sb = new StringBuilder(p.Length * 3);
            if (p != null) {
                for (int i = 0; i < p.Length; i++) {
                    sb.Append(p[i].ToString("X2").PadLeft(2, '0'));
                    if (i != p.Length - 1)
                        sb.Append(Delimiter);
                }
            }
            return sb.ToString();
        }
    }
}