diff --git a/src/addons/mod/folder/components/index/index.ts b/src/addons/mod/folder/components/index/index.ts index 40daf4693..3039947ce 100644 --- a/src/addons/mod/folder/components/index/index.ts +++ b/src/addons/mod/folder/components/index/index.ts @@ -138,7 +138,7 @@ export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceCo subfolder: folder, }; - const hash = Md5.hashAsciiStr(folder.filepath); + const hash = Md5.hashAsciiStr(folder.filepath); CoreNavigator.navigateToSitePath( `${AddonModFolderModuleHandlerService.PAGE_NAME}/${this.courseId}/${this.module.id}/${hash}`, diff --git a/src/addons/mod/wiki/components/index/index.ts b/src/addons/mod/wiki/components/index/index.ts index cb078be54..0697049ff 100644 --- a/src/addons/mod/wiki/components/index/index.ts +++ b/src/addons/mod/wiki/components/index/index.ts @@ -638,7 +638,7 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp * @returns Promise. */ protected async openPageOrSubwiki(options: AddonModWikiOpenPageOptions): Promise { - const hash = Md5.hashAsciiStr(JSON.stringify({ + const hash = Md5.hashAsciiStr(JSON.stringify({ ...options, timestamp: Date.now(), })); diff --git a/src/addons/mod/wiki/services/handlers/page-or-map-link.ts b/src/addons/mod/wiki/services/handlers/page-or-map-link.ts index 5d6b63360..c6b9f0835 100644 --- a/src/addons/mod/wiki/services/handlers/page-or-map-link.ts +++ b/src/addons/mod/wiki/services/handlers/page-or-map-link.ts @@ -59,7 +59,7 @@ export class AddonModWikiPageOrMapLinkHandlerService extends CoreContentLinksHan { siteId, readingStrategy: CoreSitesReadingStrategy.PREFER_CACHE }, ); - const hash = Md5.hashAsciiStr(JSON.stringify({ + const hash = Md5.hashAsciiStr(JSON.stringify({ pageId: page.id, pageTitle: page.title, subwikiId: page.subwikiid, diff --git a/src/addons/privatefiles/pages/index/index.ts b/src/addons/privatefiles/pages/index/index.ts index 43d699e15..a241b1474 100644 --- a/src/addons/privatefiles/pages/index/index.ts +++ b/src/addons/privatefiles/pages/index/index.ts @@ -267,7 +267,7 @@ export class AddonPrivateFilesIndexPage implements OnInit, OnDestroy { params.filename = ''; } - const hash = Md5.hashAsciiStr(JSON.stringify(params)); + const hash = Md5.hashAsciiStr(JSON.stringify(params)); CoreNavigator.navigate(`../${hash}`, { params }); } diff --git a/src/core/classes/sites/authenticated-site.ts b/src/core/classes/sites/authenticated-site.ts index a71f28237..22f614105 100644 --- a/src/core/classes/sites/authenticated-site.ts +++ b/src/core/classes/sites/authenticated-site.ts @@ -1010,7 +1010,7 @@ export class CoreAuthenticatedSite extends CoreUnauthenticatedSite { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any protected getCacheId(method: string, data: any): string { - return Md5.hashAsciiStr(method + ':' + CoreUtils.sortAndStringify(data)); + return Md5.hashAsciiStr(method + ':' + CoreUtils.sortAndStringify(data)); } /** diff --git a/src/core/features/course/services/module-prefetch-delegate.ts b/src/core/features/course/services/module-prefetch-delegate.ts index bad90946d..9fc20ea79 100644 --- a/src/core/features/course/services/module-prefetch-delegate.ts +++ b/src/core/features/course/services/module-prefetch-delegate.ts @@ -214,7 +214,7 @@ export class CoreCourseModulePrefetchDelegateService extends CoreDelegate { // Check if there's already a getCourseUpdates in progress. - const id = Md5.hashAsciiStr(courseId + '#' + JSON.stringify(modules)); + const id = Md5.hashAsciiStr(courseId + '#' + JSON.stringify(modules)); const siteId = CoreSites.getCurrentSiteId(); if (this.courseUpdatesPromises[siteId] && this.courseUpdatesPromises[siteId][id] !== undefined) { diff --git a/src/core/features/h5p/classes/core.ts b/src/core/features/h5p/classes/core.ts index 70e2c9f29..45132b185 100644 --- a/src/core/features/h5p/classes/core.ts +++ b/src/core/features/h5p/classes/core.ts @@ -140,7 +140,7 @@ export class CoreH5PCore { toHash.sort((a, b) => a.localeCompare(b)); // Calculate hash. - return Md5.hashAsciiStr(toHash.join('')); + return Md5.hashAsciiStr(toHash.join('')); } /** diff --git a/src/core/features/login/services/login-helper.ts b/src/core/features/login/services/login-helper.ts index 44ca38f7a..7f7bbfb4b 100644 --- a/src/core/features/login/services/login-helper.ts +++ b/src/core/features/login/services/login-helper.ts @@ -1104,14 +1104,14 @@ export class CoreLoginHelperProvider { // Validate the signature. // We need to check both http and https. - let signature = Md5.hashAsciiStr(launchSiteURL + passport); + let signature = Md5.hashAsciiStr(launchSiteURL + passport); if (signature != params[0]) { if (launchSiteURL.indexOf('https://') != -1) { launchSiteURL = launchSiteURL.replace('https://', 'http://'); } else { launchSiteURL = launchSiteURL.replace('http://', 'https://'); } - signature = Md5.hashAsciiStr(launchSiteURL + passport); + signature = Md5.hashAsciiStr(launchSiteURL + passport); } if (signature == params[0]) { diff --git a/src/core/features/sharedfiles/components/list/list.ts b/src/core/features/sharedfiles/components/list/list.ts index 827d06205..221a04295 100644 --- a/src/core/features/sharedfiles/components/list/list.ts +++ b/src/core/features/sharedfiles/components/list/list.ts @@ -123,7 +123,7 @@ export class CoreSharedFilesListComponent implements OnInit, OnDestroy { return; } - const hash = Md5.hashAsciiStr(path); + const hash = Md5.hashAsciiStr(path); CoreNavigator.navigate(`../${hash}`, { params: { diff --git a/src/core/features/sharedfiles/services/sharedfiles.ts b/src/core/features/sharedfiles/services/sharedfiles.ts index 2cc359bb3..166fc6119 100644 --- a/src/core/features/sharedfiles/services/sharedfiles.ts +++ b/src/core/features/sharedfiles/services/sharedfiles.ts @@ -151,7 +151,7 @@ export class CoreSharedFilesProvider { * @returns File ID. */ protected getFileId(entry: FileEntry): string { - return Md5.hashAsciiStr(entry.name); + return Md5.hashAsciiStr(entry.name); } /** diff --git a/src/core/features/siteplugins/classes/handlers/course-option-handler.ts b/src/core/features/siteplugins/classes/handlers/course-option-handler.ts index b6371dc46..1a57f74aa 100644 --- a/src/core/features/siteplugins/classes/handlers/course-option-handler.ts +++ b/src/core/features/siteplugins/classes/handlers/course-option-handler.ts @@ -87,7 +87,7 @@ export class CoreSitePluginsCourseOptionHandler extends CoreSitePluginsBaseHandl const args = { courseid: course.id, }; - const hash = Md5.hashAsciiStr(JSON.stringify(args)); + const hash = Md5.hashAsciiStr(JSON.stringify(args)); return { title: this.title, diff --git a/src/core/features/siteplugins/classes/handlers/user-handler.ts b/src/core/features/siteplugins/classes/handlers/user-handler.ts index f9028e7c2..a8a50d07a 100644 --- a/src/core/features/siteplugins/classes/handlers/user-handler.ts +++ b/src/core/features/siteplugins/classes/handlers/user-handler.ts @@ -98,7 +98,7 @@ export class CoreSitePluginsUserProfileHandler extends CoreSitePluginsBaseHandle courseid: contextId, userid: user.id, }; - const hash = Md5.hashAsciiStr(JSON.stringify(args)); + const hash = Md5.hashAsciiStr(JSON.stringify(args)); CoreNavigator.navigateToSitePath( `siteplugins/content/${this.plugin.component}/${this.handlerSchema.method}/${hash}`, diff --git a/src/core/features/siteplugins/components/only-title-block/only-title-block.ts b/src/core/features/siteplugins/components/only-title-block/only-title-block.ts index f01d98432..34a6ce1dc 100644 --- a/src/core/features/siteplugins/components/only-title-block/only-title-block.ts +++ b/src/core/features/siteplugins/components/only-title-block/only-title-block.ts @@ -58,7 +58,7 @@ export class CoreSitePluginsOnlyTitleBlockComponent extends CoreBlockBaseCompone contextlevel: this.contextLevel, instanceid: this.instanceId, }; - const hash = Md5.hashAsciiStr(JSON.stringify(args)); + const hash = Md5.hashAsciiStr(JSON.stringify(args)); CoreNavigator.navigateToSitePath( `siteplugins/content/${handler.plugin.component}/${handler.handlerSchema.method}/${hash}`, diff --git a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts index 9e215702d..695c5cd3c 100644 --- a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts +++ b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts @@ -181,7 +181,7 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck { component = component || this.component; method = method || this.method; - const hash = Md5.hashAsciiStr(JSON.stringify(args)); + const hash = Md5.hashAsciiStr(JSON.stringify(args)); CoreNavigator.navigateToSitePath(`siteplugins/content/${component}/${method}/${hash}`, { params: { diff --git a/src/core/features/siteplugins/directives/call-ws-new-content.ts b/src/core/features/siteplugins/directives/call-ws-new-content.ts index e80331f45..729a8130a 100644 --- a/src/core/features/siteplugins/directives/call-ws-new-content.ts +++ b/src/core/features/siteplugins/directives/call-ws-new-content.ts @@ -99,7 +99,7 @@ export class CoreSitePluginsCallWSNewContentDirective extends CoreSitePluginsCal } else { const component = this.component || this.parentContent?.component; const method = this.method || this.parentContent?.method; - const hash = Md5.hashAsciiStr(JSON.stringify(args)); + const hash = Md5.hashAsciiStr(JSON.stringify(args)); CoreNavigator.navigateToSitePath(`siteplugins/content/${component}/${method}/${hash}`, { params: { diff --git a/src/core/features/siteplugins/directives/new-content.ts b/src/core/features/siteplugins/directives/new-content.ts index 545991669..a22d57e2c 100644 --- a/src/core/features/siteplugins/directives/new-content.ts +++ b/src/core/features/siteplugins/directives/new-content.ts @@ -98,7 +98,7 @@ export class CoreSitePluginsNewContentDirective implements OnInit { } else { const component = this.component || this.parentContent?.component; const method = this.method || this.parentContent?.method; - const hash = Md5.hashAsciiStr(JSON.stringify(args)); + const hash = Md5.hashAsciiStr(JSON.stringify(args)); CoreNavigator.navigateToSitePath(`siteplugins/content/${component}/${method}/${hash}`, { params: { diff --git a/src/core/features/styles/services/styles.ts b/src/core/features/styles/services/styles.ts index 343e056df..67ea5f19a 100644 --- a/src/core/features/styles/services/styles.ts +++ b/src/core/features/styles/services/styles.ts @@ -218,7 +218,7 @@ export class CoreStylesService { contents = (await handler.getStyle(siteId, config)).trim(); } - const hash = Md5.hashAsciiStr(contents); + const hash = Md5.hashAsciiStr(contents); // Update the styles only if they have changed. if (this.stylesEls[siteId][handler.name] === hash) { diff --git a/src/core/services/filepool.ts b/src/core/services/filepool.ts index af8b9ab44..5b4ec6124 100644 --- a/src/core/services/filepool.ts +++ b/src/core/services/filepool.ts @@ -1303,7 +1303,7 @@ export class CoreFilepoolProvider { * @returns File download ID. */ protected getFileDownloadId(fileUrl: string, filePath: string): string { - return Md5.hashAsciiStr(fileUrl + '###' + filePath); + return Md5.hashAsciiStr(fileUrl + '###' + filePath); } /** @@ -1867,7 +1867,7 @@ export class CoreFilepoolProvider { * @returns Package ID. */ getPackageId(component: string, componentId?: string | number): string { - return Md5.hashAsciiStr(component + '#' + this.fixComponentId(componentId)); + return Md5.hashAsciiStr(component + '#' + this.fixComponentId(componentId)); } /** diff --git a/src/core/services/sites.ts b/src/core/services/sites.ts index 09a27bafd..4a3353d94 100644 --- a/src/core/services/sites.ts +++ b/src/core/services/sites.ts @@ -721,7 +721,7 @@ export class CoreSitesProvider { * @returns Site ID. */ createSiteID(siteUrl: string, username: string): string { - return Md5.hashAsciiStr(siteUrl + username); + return Md5.hashAsciiStr(siteUrl + username); } /** diff --git a/src/core/services/utils/dom.ts b/src/core/services/utils/dom.ts index 480f7dd23..129f5218f 100644 --- a/src/core/services/utils/dom.ts +++ b/src/core/services/utils/dom.ts @@ -1456,7 +1456,7 @@ export class CoreDomUtilsProvider { const listenCloseEvents = closeOnNavigate ?? true; // Default to true. // TODO: Improve this if we need two modals with same component open at the same time. - const modalId = Md5.hashAsciiStr(options.component?.toString() || ''); + const modalId = Md5.hashAsciiStr(options.component?.toString() || ''); const modal = this.displayedModals[modalId] ? this.displayedModals[modalId]