summaryrefslogtreecommitdiff
path: root/crypt.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-11-17 00:25:36 +0800
committerxuri <xuri.me@gmail.com>2021-11-17 00:25:36 +0800
commitbc3c7d51a2efe5f0ad85667a8f9636f13941d577 (patch)
treed8df81412ae201e427c3e43c6aa8638f8e3c247b /crypt.go
parentbda8e7f8129dae0064c47f8e051f76492e1128f5 (diff)
ref #65: new formula function PRICE
- fix COUPPCD result accuracy issue - update close spreadsheet example in documentation and README
Diffstat (limited to 'crypt.go')
-rw-r--r--crypt.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypt.go b/crypt.go
index 24ac7ec..ae39bba 100644
--- a/crypt.go
+++ b/crypt.go
@@ -297,7 +297,7 @@ func encryptionMechanism(buffer []byte) (mechanism string, err error) {
err = ErrUnknownEncryptMechanism
return
}
- versionMajor, versionMinor := binary.LittleEndian.Uint16(buffer[0:2]), binary.LittleEndian.Uint16(buffer[2:4])
+ versionMajor, versionMinor := binary.LittleEndian.Uint16(buffer[:2]), binary.LittleEndian.Uint16(buffer[2:4])
if versionMajor == 4 && versionMinor == 4 {
mechanism = "agile"
return
@@ -600,7 +600,7 @@ func createIV(blockKey interface{}, encryption Encryption) ([]byte, error) {
tmp := make([]byte, 0x36)
iv = append(iv, tmp...)
} else if len(iv) > encryptedKey.BlockSize {
- iv = iv[0:encryptedKey.BlockSize]
+ iv = iv[:encryptedKey.BlockSize]
}
return iv, nil
}