Skip to content

Commit

Permalink
Changes java imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mathaeussanderosp committed Jun 21, 2024
1 parent 4097d05 commit 85cec40
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/ring/middleware/anti_forgery/session.clj
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
(ns ring.middleware.anti-forgery.session
"Contains the synchronizer token (or session) strategy."
(:require [ring.middleware.anti-forgery.strategy :as strategy]
[crypto.equality :as crypto])
(:import (java.security.SecureRandom)
(java.util.Base64)))
[crypto.equality :as crypto]))

(defn- random-base64 [buffer-size]
(let [random (SecureRandom.)
base64 (.withoutPadding (Base64/getUrlEncoder))
(let [random (java.security.SecureRandom.)
base64 (.withoutPadding (java.util.Base64/getUrlEncoder))
buffer (byte-array buffer-size)]
(.nextBytes random buffer)
(.encodeToString base64 buffer)))
Expand Down

0 comments on commit 85cec40

Please sign in to comment.