Skip to content

Commit 078b645

Browse files
committed
Fix hex output for secret
1 parent 4a8d35b commit 078b645

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import _root_.io.netty.channel.unix.Errors.NativeIoException
4747
import com.google.common.cache.{CacheBuilder, CacheLoader, LoadingCache}
4848
import com.google.common.io.{ByteStreams, Files => GFiles}
4949
import com.google.common.net.InetAddresses
50+
import org.apache.commons.codec.binary.Hex
5051
import org.apache.commons.lang3.SystemUtils
5152
import org.apache.hadoop.conf.Configuration
5253
import org.apache.hadoop.fs.{FileSystem, FileUtil, Path}
@@ -2809,7 +2810,7 @@ private[spark] object Utils extends Logging {
28092810
val rnd = new SecureRandom()
28102811
val secretBytes = new Array[Byte](bits / JByte.SIZE)
28112812
rnd.nextBytes(secretBytes)
2812-
Integer.toHexString(Arrays.hashCode(secretBytes))
2813+
Hex.encodeHexString(secretBytes)
28132814
}
28142815

28152816
/**

0 commit comments

Comments
 (0)