using
System;
class
GFG {
public
static
void
Main()
{
check((
long
)8543,
"long"
);
check((
int
)8543,
"int"
);
check((
byte
)85,
"byte"
);
}
public
static
void
check(
long
val,
string
name)
{
byte
[] bytes = BitConverter.GetBytes(val);
Console.Write(name +
" hashcode:- "
);
for
(
int
i = 0; i < bytes.Length; i++) {
int
j = bytes[i].GetHashCode();
Console.Write(
"{0} "
, j);
}
Console.WriteLine(
""
);
}
public
static
void
check(
int
val,
string
name)
{
byte
[] bytes = BitConverter.GetBytes(val);
Console.Write(name +
" Hashcode: "
);
for
(
int
i = 0; i < bytes.Length; i++) {
int
j = bytes[i].GetHashCode();
Console.Write(
"{0} "
, j);
}
Console.WriteLine(
""
);
}
public
static
void
check(
byte
val,
string
name)
{
byte
[] bytes = BitConverter.GetBytes(val);
Console.Write(name +
" hashcode:- "
);
for
(
int
i = 0; i < bytes.Length; i++) {
int
j = bytes[i].GetHashCode();
Console.Write(
"{0} "
, j);
}
Console.WriteLine(
""
);
}
}