Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode11.2
osx_image: xcode11.4

env:
- ACTION=test PLATFORM=Mac DESTINATION='platform=OS X'
Expand Down
2 changes: 1 addition & 1 deletion Sources/SourceParsingFramework/Utilities/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension String {

/// The SHA256 value of this String.
public var shortSHA256Value: String {
return SHA256(self).digestString().substring(with: NSRange(location: 0, length: 20))!
return SHA256().hash(self).hexadecimalRepresentation.substring(with: NSRange(location: 0, length: 20))!
}

/// Return the same String with the first character lowercased.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ class ExtensionsTests: AbstractSourceParsingTests {
dirPath = String(filePath.prefix(upTo: index))
}

func test_sha256_verifyResults() {
let input = "Some random string"
let sha256 = input.shortSHA256Value
XCTAssertEqual(sha256, "7e2ab276842ae9fb52ae")
}

func test_isDirectory_verifyResults() {
XCTAssertFalse(filePath.isDirectory)
XCTAssertTrue(dirPath.isDirectory)
Expand Down