Skip to content

Commit da16f36

Browse files
committed
[CODEC-328] Clarify Javadoc for
org.apache.commons.codec.digest.UnixCrypt.crypt(byte[],String)
1 parent 567c084 commit da16f36

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The <action> type attribute can be add,update,fix,remove.
4747
<!-- FIX -->
4848
<action type="fix" dev="ggregory" due-to="Gary Gregory">Remove -nouses directive from maven-bundle-plugin. OSGi package imports now state 'uses' definitions for package imports, this doesn't affect JPMS (from org.apache.commons:commons-parent:80).</action>
4949
<action type="fix" dev="ggregory" due-to="Gary Gregory">Refactor DigestUtils.updateDigest(MessageDigest, File) to use NIO.</action>
50+
<action type="fix" dev="ggregory" due-to="Gary Gregory" issue="CODEC-328" >Clarify Javadoc for org.apache.commons.codec.digest.UnixCrypt.crypt(byte[],String).</action>
5051
<!-- ADD -->
5152
<action type="add" dev="ggregory" due-to="Gary Gregory">Add HmacUtils.hmac(Path).</action>
5253
<action type="add" dev="ggregory" due-to="Gary Gregory">Add HmacUtils.hmacHex(Path).</action>

src/main/java/org/apache/commons/codec/digest/UnixCrypt.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,11 @@ public static String crypt(final byte[] original) {
236236
* Using unspecified characters as salt results incompatible hash values.
237237
* </p>
238238
*
239-
* @param original
240-
* plaintext password
241-
* @param salt
242-
* a two character string drawn from [a-zA-Z0-9./]. The salt may be null, in which case a salt is
243-
* generated for you using {@link B64#getRandomSalt(int)}.
239+
* @param original plaintext password
240+
* @param salt a two character string drawn from [a-zA-Z0-9./]. The salt may be null, in which case a salt is generated for you using
241+
* {@link B64#getRandomSalt(int)}. Only the first two characters are used, others are ignored.
244242
* @return a 13 character string starting with the salt string
245-
* @throws IllegalArgumentException
246-
* if the salt does not match the allowed pattern
243+
* @throws IllegalArgumentException if the salt does not match the allowed pattern
247244
*/
248245
public static String crypt(final byte[] original, String salt) {
249246
if (salt == null) {

0 commit comments

Comments
 (0)