sync: Peak a deterministic ID if 0
This commit is contained in:
parent
85ab183bed
commit
35d07c1aa4
1 changed files with 6 additions and 0 deletions
|
@ -3,6 +3,7 @@ package sync
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"hash/adler32"
|
||||
"image"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -88,6 +89,11 @@ func parseExerciceDirname(edir string) (eid int, ename string, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// ID 0: peak a deterministic-random-ordered ID instead
|
||||
if eid == 0 {
|
||||
eid = int(adler32.Checksum([]byte(edir_splt[1])))
|
||||
}
|
||||
|
||||
ename = edir_splt[1]
|
||||
|
||||
return
|
||||
|
|
Reference in a new issue